<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        var obj = [
            {
                uname: '商品1',
                id: '1'
            },
            {
                uname: '商品2',
                id: '2'
            },
            {
                uname: '商品3',
                id: '3'
            }
        ];
        var liest = obj.find(item => item.id == 2)
        console.log(liest);
    </script>
</body>

</html>